home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15328 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: qsort on Solaris
  5. Date: 18 Apr 1996 13:44:21 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4l5gvl$b9s@sparcserver.lrz-muenchen.de>
  9. References: <3175A2A3.1664EB7F@montefiore.ulg.ac.be>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. Louis Bronne <bronne@montefiore.ulg.ac.be> writes:
  13.  
  14. >Hello !
  15.  
  16. >I'm experiencing big trouble with qsort on Solaris.
  17.  
  18. I have used qsort() on Solaris without any problems.
  19.  
  20. >My program runs well on Linux (GNU qsort) but the Solaris qsort
  21. >has a very strange behaviour. By instance, when it has to sort
  22. >only two elements, it does a comparison between the element 0 and 1
  23. >(normal !) but does it twice !
  24. >After that, it begins to compare the elements -1, -2, -3 etc. with the
  25. >0th one.
  26.  
  27. >So a happy "Segmentation fault" rises !
  28.  
  29. >Any idea ?
  30.  
  31. How did you find that out? While I can verify your observation that
  32. qsort() compares the two elements of a two element array twice, I
  33. cannot verify the other observation.
  34.  
  35. Post the code that makes you think that qsort "violates boundaries".
  36.  
  37. Kurt
  38. -- 
  39. | Kurt Watzka                             Phone : +49-89-2180-6254
  40. | watzka@stat.uni-muenchen.de
  41.